<template>
  <div>
    <div class="prosearch">
      <el-form :inline="true" :model="formPro" class="demo-form-inline">
        <el-form-item label="订单状态：" name="proauth">
          <el-select v-model="formPro.checkedOrder" placeholder="选择订单状态">
            <el-option v-for="item in formPro.order" :label="item" :value="item" :key="item"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="授权IP：" name="proauth">
          <el-select v-model="formPro.checkedSqip" placeholder="选择授权IP">
            <el-option v-for="(item , index) in formPro.sqip" :label="item" :value="item" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="被授权商名称：" name="proname">
          <el-select v-model="formPro.checkdeBsqname"  placeholder="选择被授商权">
            <el-option v-for="item in formPro.bsqname"  :label="item.merchantName" :value="item.merchantName" :key="item.merchantId"></el-option>
          </el-select>
        </el-form-item> -->
      </el-form>
    </div>
    <div class="prosearch">
      <el-form :inline="true" :model="formPro" class="demo-form-inline">
        <el-form-item label="码段：" name="proauth">
          <el-input v-model="formPro.checkdeMd" placeholder="请输入码段"></el-input>
        </el-form-item>
        <el-form-item label="商品名称：" name="proauth">
          <el-input v-model="formPro.goodName" placeholder="请输入商品名称"></el-input>
        </el-form-item>
        <el-form-item label="提交时间：" name="proname">
           <div class="block">
              <el-date-picker v-model="formPro.startDate" type="date" :picker-options="pickerStartDate" placeholder="选择日期">
              </el-date-picker>
                <span style="padding:0 10px">至</span>
              <el-date-picker v-model="formPro.endDate" type="date" :picker-options="pickerCloseDate" placeholder="选择日期" size="medium">
              </el-date-picker>
            </div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import request from '@/utils/request.js'
export default {
  name: 'ProlistSearch',
  data () {
    return {
      pickerStartDate: {
        disabledDate: time => {
          if (this.formPro.endDate) {
            return time.getTime() > this.formPro.endDate
          }
        }
      },
      pickerCloseDate: {
        disabledDate: time => {
          return time.getTime() < this.formPro.startDate
        }
      },
      formPro: {
        checkdeMd: '',
        order: ['待付款', '待确认', '待制码', '制码中', '待邮寄', '已完成', '已关闭'],
        checkedOrder: '',
        sqip: [],
        checkedSqip: '',
        bsqname: [],
        checkdeBsqname: '',
        goodName: '',
        nauth: [],
        starDate: '',
        endDate: ''
      }
    }
  },
  methods: {
    getRequit () {
      request.getBsqname().then(res => {
        this.formPro.bsqname = res
      })
      request.getIp().then(res => {
        this.formPro.sqip = res
      })
    }
  },
  mounted () {
    this.getRequit()
  },
  beforeUpdate () {
    // this.setexistsInfo()
  }
}
</script>
<style lang="stylus">
@import '~styles/varibles.styl'
.prosearch {
  margin-bottom: 12px;
}
.prosearch .el-form-item{
  margin-right: 0;
  margin-bottom: 15px;
}
.prosearch .el-form-item .el-input__inner{
  height: 36px;
  line-height: 34px;
  box-sizing: border-box;
}
.prosearch .el-form-item .el-form-item__label{
  height: 36px;
  line-height: 36px;
}
.prosearch .el-form-item[name="proname"] .el-form-item__label{
  width: 100px;
  white-space: nowrap;
  text-align: right;
  padding-right: 20px;
}
.prosearch .el-form-item[name="proIP"] .el-form-item__label{
  width: 80px;
}
.prosearch .el-form-item[name="proauth"] .el-form-item__label{
  width: 100px;
}
.prosearch .el-form-item[name="proauth"] .el-input__inner{
  width: 260px;
}
.prosearch .el-form-item[name="prostatus"] .el-form-item__label{
  width: 120px;
}
.prosearch .el-form-item[name="prostatus"] .el-input__inner{
  width: 125px;
}
.prosearch .el-form-item[name="searchpro"] button {
  font-weight: 600;
  background-color: $baseColor;
  color: #fff;
  border: 1px solid $baseColor;
  width: 90px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-size: 14px;
  border-radius: 4px;
  margin-left: 20px;
  box-sizing: border-box;
  outline: none;
  padding: 0;
}
</style>
